a tool for shared writing and social publishing
at feature/recommend 52 lines 2.1 kB view raw
1"use client"; 2import { Sidebar } from "components/ActionBar/Sidebar"; 3import { useEntitySetContext } from "components/EntitySetProvider"; 4import { HelpButton } from "app/[leaflet_id]/actions/HelpButton"; 5import { HomeButton } from "app/[leaflet_id]/actions/HomeButton"; 6import { Media } from "components/Media"; 7import { useLeafletPublicationData } from "components/PageSWRDataProvider"; 8import { ShareOptions } from "app/[leaflet_id]/actions/ShareOptions"; 9import { ThemePopover } from "components/ThemeManager/ThemeSetter"; 10import { PublishButton } from "./actions/PublishButton"; 11import { Watermark } from "components/Watermark"; 12import { BackToPubButton } from "./actions/BackToPubButton"; 13import { useIdentityData } from "components/IdentityProvider"; 14import { useReplicache } from "src/replicache"; 15 16export function LeafletSidebar() { 17 let entity_set = useEntitySetContext(); 18 let { rootEntity } = useReplicache(); 19 let { data: pub } = useLeafletPublicationData(); 20 let { identity } = useIdentityData(); 21 22 return ( 23 <Media mobile={false} className="w-0 h-full relative"> 24 <div 25 className="absolute top-0 left-0 h-full flex justify-end " 26 style={{ width: `calc(50vw - ((var(--page-width-units)/2))` }} 27 > 28 <div className="sidebarContainer flex flex-col justify-end h-full w-16 relative"> 29 {entity_set.permissions.write && ( 30 <Sidebar> 31 <PublishButton entityID={rootEntity} /> 32 <ShareOptions /> 33 <ThemePopover entityID={rootEntity} /> 34 <HelpButton /> 35 <hr className="text-border" /> 36 {pub?.publications && 37 identity?.atp_did && 38 pub.publications.identity_did === identity.atp_did ? ( 39 <BackToPubButton publication={pub.publications} /> 40 ) : ( 41 <HomeButton /> 42 )} 43 </Sidebar> 44 )} 45 <div className="h-full flex items-end"> 46 <Watermark /> 47 </div> 48 </div> 49 </div> 50 </Media> 51 ); 52}